<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>{% block title %}{% endblock %}</title>
    <meta name="description" content="{% block description %}{% endblock %}">
    <meta name="keywords" content="{% block keywords %}{% endblock %}">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link rel="shortcut icon" href="{{ url_for('static', filename='dist/images/favicon.ico') }}" type="image/x-icon">
    <!--link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.5.0/css/font-awesome.min.css"-->
    <!--link rel="stylesheet" href="{{ url_for('static', filename='dist/styles/libs/bootstrap/3.3.5/bootstrap.min.css') }}"--> <!-- TODO delete -->
    <link href="//cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="{{ url_for('static', filename='dist/styles/page-dashboard.css') }}">
    {% block css %}{% endblock %}
    <!--[if lte IE 7]>
    <script type="text/javascript">
        window.location.href = "{{ url_for('main.kill_ie', _external=True) }}";
    </script>
    <![endif]-->
    <!-- [if lt IE 9]>
    <script src="{{ url_for('static', filename='dist/scripts/plugins/html5shiv.min.js') }}"></script>
    <script src="{{ url_for('static', filename='dist/scripts/plugins/respond.min.js') }}"></script>
    <!-- [endif] -->
</head>
<body class="dashboard{{ ' ' }}{%- block body_class %}{%- endblock %}">
    <div class="settings-panel"></div> <!-- TODO top panel -->
    <div class="page-container">
        <!-- 边栏 -->
        <div class="sidebar-menu fixed">
            <div class="sidebar-menu-inner ps-container">
                <header class="logo-env">
                    <div class="logo pull-left">
                        <a href="{{ url_for('main.index') }}" class="logo-expanded"><span class="glyphicon glyphicon-fire"></span>Plog</a>
                        <a href="{{ url_for('main.index') }}" class="logo-collapsed"><span class="glyphicon glyphicon-fire"></span></a>
                    </div>
                    <div class="clearfix"></div>
                </header>
                <ul class="main-menu list-unstyled" id="main-menu">
                    {% import 'macros/dash_sidemenu.html' as menu_class_render %}
                    <li class="has-sub {{- menu_class_render.get_menu_class('dashboard.posts') -}}">
                        <a href="javascript:void(0)"><span class="glyphicon glyphicon-send"></span>文章</a>
                        <ul class="sub-menu">
                            <li class="{{- menu_class_render.get_menu_class('dashboard.all_posts', 'sub') -}}"><a href="{{ url_for('dashboard.all_posts') }}">所有文章</a> </li>
                            <li class="{{- menu_class_render.get_menu_class('dashboard.new_post', 'sub') -}}"><a href="{{ url_for('dashboard.new_post') }}">新文章</a> </li>
                        </ul>
                    </li>
                    <li class="has-sub {{- menu_class_render.get_menu_class('dashboard.users') -}}">
                        <a href="javascript:void(0)"><span class="glyphicon glyphicon-user"></span>用户</a>
                        <ul class="sub-menu">
                            <li class="{{- menu_class_render.get_menu_class('dashboard.all_users', 'sub') -}}"><a href="{{ url_for('dashboard.all_users') }}">用户列表</a> </li>
                            <li class="{{- menu_class_render.get_menu_class('dashboard.new_user', 'sub') -}}"><a href="{{ url_for('dashboard.new_user') }}">添加用户</a> </li>
                            <li class="{{- menu_class_render.get_menu_class('dashboard.my_profile', 'sub') -}}"><a href="{{ url_for('dashboard.my_profile') }}">个人资料</a> </li>
                        </ul>
                    </li>
                    <li class="has-sub {{- menu_class_render.get_menu_class('dashboard.tags') -}}">
                        <a href="javascript:void(0)"><span class="glyphicon glyphicon-tags"></span>标签</a>
                        <ul class="sub-menu">
                            <li class="{{- menu_class_render.get_menu_class('dashboard.all_tags', 'sub') -}}"><a href="{{ url_for('dashboard.all_tags') }}">标签列表</a> </li>
                        </ul>
                    </li>
                    <li class="has-sub {{- menu_class_render.get_menu_class('dashboard.appearance') -}}">
                        <a href="javascript:void(0)"><span class="glyphicon glyphicon-eye-open"></span>外观</a>
                        <ul class="sub-menu">
                            <li class="{{- menu_class_render.get_menu_class('dashboard.navigations', 'sub') -}}"><a href="{{ url_for('dashboard.navigations') }}">顶部菜单</a> </li>
                            <li class="{{- menu_class_render.get_menu_class('dashboard.footer_navigations', 'sub') -}}"><a href="{{ url_for('dashboard.footer_navigations') }}">页脚导航</a> </li>
                        </ul>
                    </li>
                    <li class="has-sub {{- menu_class_render.get_menu_class('dashboard.settings') -}}">
                        <a href="javascript:void(0)"><span class="glyphicon glyphicon-cog"></span>设置</a>
                        <ul class="sub-menu">
                            <li class="{{- menu_class_render.get_menu_class('dashboard.general_setting', 'sub') -}}"><a href="{{ url_for('dashboard.general_setting') }}">常规</a> </li>
                            <li class="{{- menu_class_render.get_menu_class('dashboard.writing_setting', 'sub') -}}"><a href="{{ url_for('dashboard.writing_setting') }}">写作</a> </li>
                            <li class="{{- menu_class_render.get_menu_class('dashboard.reading_setting', 'sub') -}}"><a href="{{ url_for('dashboard.reading_setting') }}">阅读</a> </li>
                            <li class="{{- menu_class_render.get_menu_class('dashboard.discussion_setting', 'sub') -}}"><a href="{{ url_for('dashboard.discussion_setting') }}">讨论</a> </li>
                            <li class="{{- menu_class_render.get_menu_class('dashboard.cdn_setting', 'sub') -}}"><a href="{{ url_for('dashboard.cdn_setting') }}">CDN</a> </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
        <!-- End 边栏 -->
        <!-- 内容区 -->
        <div class="main-content">
            <!-- 顶部导航 -->
            <nav class="navbar user-info-navbar" role="navigation">
                <ul class="user-info-menu left-links list-inline list-unstyled pull-left">
                    <li class="hidden-sm hidden-xs">
                        <a href="javascript:void(0)" data-toggle="sidebar"><span class="glyphicon glyphicon-menu-hamburger"></span></a>
                    </li>
                    <li class="dropdown hover-line">
                        <a href="javascript:void(0)" data-toggle="dropdown">
                            <span class="glyphicon glyphicon-envelope"></span>
                            <span class="badge badge-green">15</span> <!-- TODO 消息数量 -->
                        </a>
                        <ul class="dropdown-menu messages">
                            <!-- 显示部分消息 -->
                            <li>
                                <ul class="dropdown-menu-list list-unstyled ps-scrollbar ps-container ps-active-y">
                                    <li class="active">消息1</li>
                                    <li class="">消息2</li>
                                </ul>
                            </li>
                            <!-- 链接至全部消息 -->
                            <li class="external"><a href="/allmessages" target="_blank"><span>All Messages</span></a></li>
                        </ul>
                    </li>
                    <li class="dropdown hover-line">
                        <a href="javascript:void(0)" data-toggle="dropdown">
                            <span class="glyphicon glyphicon-bell"></span>
                            <span class="badge badge-purple">7</span> <!-- TODO 通知数量 -->
                        </a>
                        <ul class="dropdown-menu notifications">
                            <li class="top">
                                <p class="small">
                                    <a href="javascript:void(0)" class="pull-right">Mark all read</a>You have <strong>3</strong> new notifications
                                </p>
                            </li>
                            <li>
                                <ul class="dropdown-menu-list list-unstyled ps-scrollbar ps-container ps-active-y">
                                    <li class="active">通知1</li>
                                    <li class="">通知2</li>
                                </ul>
                            </li>
                            <!-- 链接至全部通知 -->
                            <li class="external"><a href="/allnotifications" target="_blank"><span>All Notifications</span></a></li>
                        </ul>
                    </li>
                </ul>
                <ul class="user-info-menu right-links list-inline list-unstyled pull-right">
                    <li class="dropdown user-profile">
                        <a href="javascript:void(0)" data-toggle="dropdown">
                            <img class="avatar" src="{{ current_user.get_avatar(30) }}">
                            <span class="name">{{ current_user.nickname }}</span>
                            <span class="glyphicon glyphicon-menu-down"></span>
                        </a>
                        <ul class="dropdown-menu user-profile-menu list-unstyled">
                            <li>
                                <a href="{{ url_for('dashboard.new_post') }}"><span class="glyphicon glyphicon-edit"></span>发布文章</a>
                            </li>
                            <li>
                                <a href="{{ url_for('dashboard.my_profile') }}"><span class="glyphicon glyphicon-user"></span>个人资料</a>
                            </li>
                            <li>
                                <a href="{{ url_for('dashboard.settings') }}"><span class="glyphicon glyphicon-wrench"></span>设置</a>
                            </li>
                            <li class="last">
                                <a href="{{ url_for('auth.logout') }}"><span class="glyphicon glyphicon-log-out"></span>登出</a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </nav>
            <!-- 页面标题区 -->
            {% block page_headtitle %}{% endblock %} <!-- TODO 根据页面确定是否需要 -->
            <!-- 内容 -->
            {% block page_content %}{% endblock %}
            <!-- 页脚 -->
            <footer class="main-footer sticky">
                <div class="inner">
                    <div class="footer-text pull-left">
                        &copy;&nbsp;2016&nbsp;<strong>{{ Setting.get_setting('blogtitle', 'Plog') }}</strong>&nbsp;Powered by Plog.
                    </div>
                    <div class="go-top pull-right">
                        <a href="javascript:void(0)" rel="go-top"><span class="glyphicon glyphicon-menu-up"></span></a>
                    </div>
                </div>
            </footer>
        </div>
        <!-- End 主体 -->
    </div>
    {% block body_end %}
    {% endblock %}


<!--script src="//cdn.bootcss.com/jquery/2.2.0/jquery.min.js"></script-->
<script type="text/javascript" src="{{ url_for('static', filename='dist/scripts/libs/jquery/2.2.0/jquery.min.js') }}"></script>
<script src="//cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script type="text/javascript" src="{{ url_for('static', filename='dist/scripts/page-dashboard.js') }}"></script>

{% block script %}
{% endblock %}
</body>
</html>